<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
   
</body>

</html>
<script>
    //proxy是ES6新增的语法 是一个构造函数

    let arr = ['写代码', '学vue', '学react', '写bug']

    let proxyArr = new Proxy(arr, {

        get(target, key, value) {
            // console.log('taget==get', target)
            // console.log('key==get', key)
            // console.log('value==get', value)
            return Reflect.get(target, key)
        },
        set(target, key, value) {
            // console.log('target==set', target)
            // console.log('key==set', key)
            // console.log('value==set', value)
            Reflect.set(target, key, value)

        },
    })
</script>